package day06;

public class txt13 {
    public static void main(String[] args) {
        int[]a={1,2,3,4,5};
        int ans=0;
        for (int i : a) {
            ans=ans+a[i];
            System.out.println(ans);

        }


        int[]a1={1,2,3,4,5};
        int ans1=0;
        for (int i = 0; i < a1.length; i++) {
            ans1=ans1+a[i];
            System.out.println(ans1);
        }
    }
}
